<?php
//$time = $_SERVER['REQUEST_TIME'];
//$log  = '/data/log/web/test_nginx.log';
//file_put_contents($log, $time . PHP_EOL, FILE_APPEND);
include '/var/www/terminal/a.php';
exit;





//var_export($output);
exit;

$sql = "SELECT id,terminal,salerid FROM uu_land WHERE terminal_type=1 and status=1 LIMIT 100";
$stmt = $db->prepare($sql);
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $lands[$row['id']] = [
        $row['terminal'],
        $row['salerid'],
    ];
}
//print_r($lands);
$sql_tickets = "SELECT id,pid,landid,apply_did FROM uu_jq_ticket WHERE landid IN(".implode(',', array_keys($lands)).")";
//echo $sql_tickets;
$stmt = $db->prepare($sql_tickets);
$stmt->execute();
$today = date('Y-m-d');
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $fprice = $soap->get_Dynamic_Price_Merge($row['pid'], $today, 1, '', '', 0);//当日供应价
    if ($fprice==-1) continue;
    $data[$row['landid']][] = array(
        'tid'=>$row['id'],
        'terminal'=>$lands[$row['landid']][0],
        'salerid'=>$lands[$row['landid']][1],
        'apply_did'=>$row['apply_did'],
    );
}

file_put_contents('/var/log/web/order_data_prepare.php', "\<?php return " . var_export($data, true) . ";");


